package com.legendframework.core.log.enums;

/**
 * @author 196
 * @Description:
 * @date 2019/12/12 10:47
 */
public enum LoggerLevelEnum{
    DEBUG(4),
    WARN(3),
    ERROR(2),
    INFO(1);

    private int level;

    LoggerLevelEnum(int level){
        this.level = level;
    }

    public int getLevel() {
        return level;
    }

    public static LoggerLevelEnum getByName(String name){
        for (LoggerLevelEnum value : values()) {
            if (value.name().equals(name)) {
                return value;
            }
        }
        return null;
    }
}